﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Comsenz.Base;
using Lbb.Web;

namespace Comsenz.Discuz
{
    /// <summary>
    /// Discuz 会员管理器
    /// </summary>
    /// <author>Chiron</author>
    public static class DiscuzMemberManager
    {
        /// <summary>
        /// 通讯器
        /// </summary>
        private readonly static CommunicatorBase communicator = new DiscuzApiCommunicator();
        /// <summary>
        /// 执行操作
        /// </summary>
        private static string Do(string action, IEnumerable<QueryParameter> args = null, IEnumerable<QueryParameter> extArgs = null)
        {
            return communicator.Do("member", action, args, extArgs);
        }
        /// <summary>
        /// 激活会员
        /// </summary>
        /// <param name="uid">会员ID</param>
        /// <returns></returns>
        public static bool Activate(int uid)
        {
            return Do("activate", new[] { 
                new QueryParameter("uid",uid)
            }) == "1";
        }
    }
}
